package cn.edu.tjufe.llp.tin.dto.sys;

import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SysUserDto {
	
	@Min(value = 0, message = "ID错误。")
	private long id;

	@NotBlank(message = "用户名不能为空。")
    @Size(min = 3, max = 32, message = "用户名最短3个字符，最长为32个字符。")
    private String username;
 
    @NotBlank(message = "密码不能为空。")
    @Size(min = 6, message = "密码最短为6个字符。")
    private String password;
    
	@NotBlank(message = "昵称不能为空。")
	@Size(max = 32, message = "昵称最长为32字符。")
	private String nickname;

	@NotBlank(message = "真实姓名不能为空。")
	@Size(max = 32, message = "真实姓名最长为32字符。")
	private String realname;
	
	@Size(max = 32, message = "电话号码最长为32字符。")
	private String phone;

    @Size(max = 32, message = "电子邮件地址最长为32字符。")
    @Email(message = "电子邮件格式错误。")
    private String email;
    
    private String photo;
    
    private Set<SysRoleDto> roles = new HashSet<>(0);

}
